package com.anche.cywebnew;

import com.anche.cywebnew.factory.YamlPropertySourceFactory;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.PropertySource;
import org.springframework.scheduling.annotation.EnableScheduling;

import java.io.File;

@SpringBootApplication
@EnableScheduling
@PropertySource(factory = YamlPropertySourceFactory.class, value = "classpath:config.yml")
public class CywebnewApplication extends SpringBootServletInitializer {

    public static void main(String[] args) {
        SpringApplication.run(CywebnewApplication.class, args);
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(CywebnewApplication.class);
    }
}
